package main

import (
	"com.cyt.common/grpc/pb"
	"com.cyt.common/grpc/server/service"
	"com.cyt.common/library/servicediscov/etcd"
	"google.golang.org/grpc"
)

const listenOn  = "127.0.0.1:9090"

func main() {
	addrs := []string{"127.0.0.1:2379"}
	r, _ := etcd.NewRegistry(addrs, "hello.rpc", listenOn).KeepAlive(5)

	srv, _ := etcd.NewServer(listenOn, func(s *grpc.Server) {
		pb.RegisterGreeterServer(s, &service.Hello{})
	})
	r.Start(srv)
}